package router

import (
	"github.com/facebookgo/inject"
	"github.com/teambition/gear"
	"jgt-oper/src/api"
	"jgt-oper/src/context"
)

// APIEVMap 移动端端企业-门禁管理 相关路由
func APIEVMap(g *inject.Graph, router *gear.Router) {
	a := new(api.AEVController)
	err := g.Provide(&inject.Object{Value: a})
	if err != nil {
		panic(err)
	}
	//	创建来访
	router.Post("/enterprise-visit/create", context.WrapContext(a.Create))
	//	查询常用访客
	router.Get("/enterprise-visit/frequently/detail", context.WrapContext(a.QueryFrequently))
	//	查询分页
	router.Get("/enterprise-visit/page", context.WrapContext(a.QueryPage))
	//	查询来访详情
	router.Get("/enterprise-visit/visit-detail", context.WrapContext(a.QueryVisitDetail))
	//	查询默认门牌
	router.Get("/enterprise-visit/default", context.WrapContext(a.QueryDefaultPark))
	//	查询直接子节点
	router.Get("/enterprise-visit/park", context.WrapContext(a.QueryParkNodes))
	//	查询默认下拉框节点分组
	router.Get("/enterprise-visit/default-park", context.WrapContext(a.QueryDefaultNodes))
	//	查询子孙节点
	router.Get("/enterprise-visit/query-children-nodes", context.WrapContext(a.QueryChildrenNodes))
	//	取消来访
	router.Put("/enterprise-visit/cancel/:id", context.WrapContext(a.Cancel))
	//	重发短信
	router.Put("/enterprise-visit/resend/:id", context.WrapContext(a.Resend))
}
